package com.Utils;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.listener.FlightExcelLisener;
import com.pojo.FlightExcel;

import java.io.File;

/**
 * 转换轨迹点
 */

public class FlghtExcel {
    public static void main(String[] args) {
        String filePath = "F:\\desktop\\projectNow\\study\\轨迹点\\";
        File file = new File(filePath);
        //用数组把文件夹下的文件存起来
        File[] files = file.listFiles();
        for (File file1 : files) {
            if (file1.isFile()) {
                String name = file1.getName();
                System.out.println(name);
                FlightExcelLisener flightExcelLisener = new FlightExcelLisener();
                flightExcelLisener.setFileName(name);
                flightExcelLisener.setExportFolders(filePath+"out\\");
                ExcelReader excelReader = EasyExcel.read(filePath+name, FlightExcel.class, flightExcelLisener).build();
                ReadSheet readSheet = EasyExcel.readSheet(0).build();
                excelReader.read(readSheet);
                excelReader.finish();
            }
        }
    }
}
